<template>
	<view>
		<view class=".head">
			<view class="cu-avatar img round margin-left" :style="{ 'background-image': 'url(' + avator + ')' }"></view>
		</view>
		<celllist></celllist>
	</view>
</template>

<script>
	import { mapState } from 'vuex'
	import headimg from '@/modul/Aboutme/headimg.vue'
	import celllist from '@/modul/Aboutme/celllist.vue'
	import Dialog from '@/modul/common/Dialog.vue'
	import { getuserInfo } from '@/store/api.js'
	export default {
		computed: {
			// 使用对象展开运算符将 mapState 的结果混入计算属性
			...mapState({
				// 映射 this.token 到 this.$store.state.token
				token: 'token',
			})
		},
		onShow() {
			getuserInfo().then(data => {
				console.log(data)
				this.avator =data.data.avatar? data.data.avatar:'http://8.146.208.139:4000/avator/orignavator.png'
			})
		},
		components: {
			headimg,
			celllist,
			Dialog
		},
		data() {
			return {
				avator: '',
				mes: {}
			};
		}
	}
</script>

<style lang="scss" scoped>
	.head{
		width: 100vw;
		margin-top: 10vh;
		text-align: center;
	}
	.img {
		margin: 0 auto;
		width: 40vw;
		height: 40vw;
	}
</style>